package org.acris2d.renderers;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import org.acris2d.nodes.ARScene;
import org.acris2d.utils.ARColor;

import android.opengl.GLSurfaceView;
import android.util.Log;

public class ARRenderer implements GLSurfaceView.Renderer {

	private Log log;
	
	protected ARColor clearColor;
	
	protected ARScene scene;
	
	private ARRenderer(ARColor clearColor, ARScene scene){
		this.clearColor = clearColor;
		this.scene = scene;
	}
	
	public ARRenderer(){
		this(ARColor.black(), null);
	}
	
	public ARRenderer(ARColor clearColor){
		this.clearColor = clearColor;
	}
	
	private void render() throws Exception{
		//TODO
		throw new Exception("NOT IMPLEMENTED");
	}
	
	public void render(ARScene scene) throws Exception{
		this.scene = scene;
		render();
	}
	
	
	@Override
	public void onDrawFrame(GL10 gl) {
		gl.glClearColor(clearColor.rComponent, clearColor.gComponent, clearColor.bComponent, clearColor.alpha);
		///RENDER HERE
	}

	@Override
	public void onSurfaceChanged(GL10 gl, int width, int height) {
		
	}

	@Override
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
		
	}

}
